{% extends "base.html" %}
{% comment 'header' %}
# This file is part of opentaps Smart Energy Applications Suite (SEAS).

# opentaps Smart Energy Applications Suite (SEAS) is free software:
# you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.

# opentaps Smart Energy Applications Suite (SEAS) is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Lesser General Public License for more details.

# You should have received a copy of the GNU Lesser General Public License
# along with opentaps Smart Energy Applications Suite (SEAS).
# If not, see <https://www.gnu.org/licenses/>.
{% endcomment %}

{% load static i18n %}
{% block title %}Report{% endblock %}

{% block content %}
<div class="container">

  {% include "core/_breadcrumbs.html" %}

  <div class="card mb-3">
    <div class="card-body table-responsive" style="height:740px;overflow-y:auto;">
      {% if report_name %}
        <h4>{{ report_name }}</h4>
      {% endif %}
      <table class="table table-sm table-striped table-bordered">
        {% if report_header %}
        <thead>
          <tr>
            {% for header in report_header %}
              {% for col in header %}
                <th scope="col">{{ col }}</th>
              {% endfor %}
            {% endfor %}
          </tr>
        </thead>
        {% endif %}
        {% if report_rows %}
        <tbody>
          {% for row in report_rows %}
             <tr>
              {% for col in row %}
                {% if col.op and col.op == 'updated' %}
                    <td scope="col"><span style="color:lightseagreen;">{{ col.value }}</span></td>
                {% elif col.op and col.op == 'removed' %}
                    <td scope="col"><span style="color:red;text-decoration: line-through;">{{ col.value }}</span></td>
                {% else %}
                    <td scope="col">{{ col.value }}</td>
                {% endif %}
              {% endfor %}
            </tr>
          {% endfor %}
        </tbody>
        {% endif %}
      </table>
    </div>
  </div>
</div>
{% endblock content %}
